package com.neutech.vo;

public class ResultVO {
    private Integer status;
    private String message;
    private Object data;

    private static final ResultVO DEFAULT_SUCCESS = new ResultVO(0,"成功");

    public static ResultVO success(){
        return DEFAULT_SUCCESS;
    }

    public static ResultVO success(String message){
        ResultVO resultVO = new ResultVO(0,message);
        return resultVO;
    }

    public static ResultVO success(Object data){
        ResultVO resultVO = new ResultVO(0,"成功");
        resultVO.data = data;
        return resultVO;
    }

    public static ResultVO error(Integer status,String message){
        ResultVO resultVO = new ResultVO(status,message);
        return resultVO;

    }

    public ResultVO() {
    }

    public Integer getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }

    public ResultVO(Integer status, String message) {
        this.status = status;
        this.message = message;
    }
}
